@section("extra-css")
    {{ HTML::style('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/smoothness/jquery-ui.css')}}
    {{ HTML::style('css/file-upload/jquery.fileupload.css')}}
    {{ HTML::style('css/file-upload/jquery.fileupload-ui.css')}}
    <noscript><link rel="stylesheet" href="css/file-upload/jquery.fileupload-noscript.css"></noscript>
    <noscript><link rel="stylesheet" href="css/file-upload/jquery.fileupload-ui-noscript.css"></noscript>
@stop
{{ Form::open(array('method' => 'POST', "id" => "fileupload",'files'=> true, "style"=>"z-index:1055")) }}
    <div class="row fileupload-buttonbar" style="margin-bottom:-50px;">
        <div class="col-lg-12 left">
            <span class="btn btn-success fileinput-button">
                <i class="glyphicon glyphicon-plus"></i>
                <span>Add</span>
                <input type="file" name="file[]" multiple>
                <input type="hidden" name="galleryID" value="{{$gallery->id}}">
            </span>
            <button type="submit" class="btn btn-primary start">
                <i class="glyphicon glyphicon-upload"></i>
                <span>Upload</span>
            </button>
            <button type="reset" class="btn btn-warning cancel">
                <i class="glyphicon glyphicon-ban-circle"></i>
                <span>Cancel</span>
            </button>
            <button type="button" class="btn btn-danger delete">
                <i class="glyphicon glyphicon-trash"></i>
                <span>Delete</span>
            </button>
            <input type="checkbox" class="toggle">
            <!-- The global file processing state -->
            <span class="fileupload-process"></span>
        </div>
        <!-- The global progress state -->
    </div>
    <div class="row">
        <div class="col-lg-5 right fileupload-progress fade">
            <!-- The global progress bar -->
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                <div class="progress-bar progress-bar-success" style="width:0%;"></div>
            </div>
            <!-- The extended global progress state -->
            <div class="progress-extended">&nbsp;</div>
        </div>
    </div>
    <div class="end"></div>
    <div style="clear:both"></div>
     <!-- The table listing the files available for upload/download -->
    <div id="respuesta_estado_orden" class="hidden alert fade in">
        <div class="left">
            <div id="data_resp_ajax_order"></div>
        </div>
        <div class="right">
            <button class="btn_close_messeger close" data-dismiss="alert" type="button">×</button>
        </div>
        <div class="end"></div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <!--<div class="dropfile m-t block"><small>Drag & Drop Files Here!</small></div>-->
            <table role="presentation" class="table table-striped" width="100%"><tbody class="files"></tbody></table>
        </div>
    </div>
{{ Form::close() }} 
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade" order-photo="{%=file.file_managerID%}">
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <p class="size">Processing...</p>
            <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
        </td>
        <td style="text-align:right;">
            {% if (!i && !o.options.autoUpload) { %}
                <button class="btn btn-primary start" disabled>
                    <i class="glyphicon glyphicon-upload"></i>
                    <span>Start</span>
                </button>
            {% } %}
            {% if (!i) { %}
                <button class="btn btn-warning cancel">
                    <i class="glyphicon glyphicon-ban-circle"></i>
                    <span>Cancel</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>
<script id="template-download" type="text/x-tmpl">
</script>
@section('extra-javascript')
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="{{ asset('js/file-upload/vendor/jquery.ui.widget.js') }}"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="http://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="http://blueimp.github.io/JavaScript-Load-Image/js/load-image.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="{{ asset('js/file-upload/jquery.iframe-transport.js')}}"></script>
<!-- The basic File Upload plugin -->
<script src="{{ asset('js/file-upload/jquery.fileupload.js')}}"></script>
<!-- The File Upload processing plugin -->
<script src="{{ asset('js/file-upload/jquery.fileupload-process.js')}}"></script>
<!-- The File Upload image preview & resize plugin -->
<script src="{{ asset('js/file-upload/jquery.fileupload-image.js')}}"></script>
<!-- The File Upload validation plugin -->
<script src="{{ asset('js/file-upload/jquery.fileupload-validate.js')}}"></script>
<!-- The File Upload user interface plugin -->
<script src="{{ asset('js/file-upload/jquery.fileupload-ui.js')}}"></script>
<!-- The main application script -->
<script>
jQuery(function ($) {

    $.ajaxSetup({
        headers: {
            'X-CSRF-Token': $('#fileupload input[name="_token"]').val()
        }
    });

    $('#fileupload').fileupload({
        disableImageResize: false,
        url: "{{ URL::to('admin/gallery/upload-image', $gallery->galleryID) }}"
    }).bind('fileuploadalways', function(){
        window.location.reload();
    });
});
</script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
<!--[if (gte IE 8)&(lt IE 10)]>
<script src="js/cors/jquery.xdr-transport.js"></script>
-->
@parent
@stop

